package com.cherrish.demo.proxy;

public class ProxyTest {
    public static void main(String[] args) {
        //ArithmeticCalculator arithmeticCalculator = new ArithmeticCalculatorImpl();
        //int add = arithmeticCalculator.add(10, 2);
        //int sub = arithmeticCalculator.sub(10, 2);
        //int mul = arithmeticCalculator.mul(10, 2);
        //int div = arithmeticCalculator.div(10, 2);
        ArithmeticCalculator target = new ArithmeticCalculatorImpl();
        ArithmeticCalculator proxy = new ArithmeticCalculatorLogProxy(target).getLogProxy();
        int add = proxy.add(10, 2);
        int sub = proxy.sub(10, 2);
        int mul = proxy.mul(10, 2);
        int div = proxy.div(10, 2);

        System.out.println("add = " + add);
        System.out.println("sub = " + sub);
        System.out.println("mul = " + mul);
        System.out.println("div = " + div);
    }
}
